cmake_minimum_required(VERSION 3.23.1 FATAL_ERROR)

set(NANOFAISS_LANGUAGES CXX)

project(nanofaiss
        VERSION 0.0.1
        DESCRIPTION "A library for efficient similarity search and clustering of dense vectors."
        HOMEPAGE_URL "https://gitee.com/FisherKK/nano-faiss"
        LANGUAGES ${NANOFAISS_LANGUAGES})

# aim for install nano-nanofaiss,
# include CMAKE_INSTALL_PREFIX, CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_LIBDIR
include(GNUInstallDirs)

set(CMAKE_CXX_STANDARD 17)

# include sub-module cmake
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

# Valid values are "generic", "avx2", "avx512".
option(NANOFAISS_OPT_LEVEL "" "generic")

# handle nanofaiss subdirectory
add_subdirectory(nanofaiss)

# add tutorial
add_subdirectory(tutorial)

# cmake test framework
include(CTest)
